//
//  BLOrder_Cell_Pearl.m
//  Byelone
//
//  Created by 乔小乔 on 2021/2/11.
//

#import "BLOrder_Cell_Pearl.h"

@implementation BLOrder_Cell_Pearl

- (void)awakeFromNib {
    [super awakeFromNib];
    self.viewBj.layer.shadowColor = [UIColor colorWithRed:8/255.0 green:6/255.0 blue:4/255.0 alpha:0.07].CGColor;
    self.viewBj.layer.shadowOffset = CGSizeMake(0,0);
    self.viewBj.layer.shadowOpacity = 1;
    self.viewBj.layer.shadowRadius = 5;
    self.viewBj.layer.cornerRadius = 5;
    
    self.btnSend.layer.cornerRadius = 12.5;
    self.btnSend.layer.masksToBounds = YES;
    self.viewTip.layer.cornerRadius = 6.25;
    self.viewTip.layer.masksToBounds = YES;
    self.imgHeader.layer.cornerRadius = 20;
    self.imgHeader.layer.masksToBounds = YES;
    
    [self.btnSend setGradientBackgroundWithColors:@[[UIColor chColorWithHexString:@"#FFBC6A"],[UIColor chColorWithHexString:@"#FF8548"]] locations:@[@(0.0f), @(1.0f)]  startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
    [self.viewTip setGradientBackgroundWithColors:@[[UIColor chColorWithHexString:@"#FFBC6A"],[UIColor chColorWithHexString:@"#FF8548"]] locations:@[@(0.0f), @(1.0f)]  startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)reloadWith:(BLOtherItem *)model{
    [self.imgHeader sd_setImageWithURL:[NSURL URLWithString:model.userHomeBaseVo.picture?:@""]];
    self.labelName.text = model.userHomeBaseVo.nickname;
    NSString *strDesc = [NSString stringWithFormat:@"%@cm | %@kg | %ld岁",model.userHomeBaseVo.height,model.userHomeBaseVo.weight,model.userHomeBaseVo.age];
    self.labelDesc.text =strDesc;
    
    NSString *strUnit = @"+";
    if ([model.giftPayType isEqualToString:@"1"]) {
        self.labelMark.textColor = [UIColor chColorWithHexString:@"#47C929"];
    }else{
        strUnit = @"-";
        self.labelMark.textColor = [UIColor chColorWithHexString:@"#FB5E5E"];
    }
    NSString *strAmount = [NSString stringWithFormat:@"%@%@",strUnit,model.giftAmount];
    self.labelMark.text = strAmount;
    
    self.labelTip.text = @"赠送";
    self.labelTime.text = [NSDate stringFullDateTimeStamp:model.createTime];
}
@end
